﻿<Page
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:viewModel="clr-namespace:FitnessTrackerUI.ViewModel" 
        xmlns:commandModel="clr-namespace:FitnessTrackerUI.Command" 
        x:Class="FitnessTrackerUI.View.WorkoutPage"
        Title="Running With Windows"
        WindowTitle="Running With Windows - Workout">
    <Page.Resources>
        <viewModel:WorkoutPagePropertiesViewModel x:Key="PropertiesViewModel"/>
        <commandModel:WorkoutCommands x:Key="CommandsViewModel"/>
    </Page.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBox Text="{Binding CurrentHeartRate}" HorizontalAlignment="Center" Margin="0" TextWrapping="Wrap"  VerticalAlignment="Center" IsEnabled="False" TextAlignment="Center" FontSize="24" FontWeight="Bold" Grid.Column="1" Grid.Row="1">
            <TextBox.DataContext>
                <Binding Source="{StaticResource PropertiesViewModel}"/>
            </TextBox.DataContext>
        </TextBox>
        <Label Content="Current Heart Rate" HorizontalAlignment="Left" Margin="20,21,0,0" VerticalAlignment="Top" Grid.Row="1" VerticalContentAlignment="Center" FontSize="16"/>
        <Label Content="Moving Heart Rate Avg Over 60 sec" HorizontalAlignment="Left" Margin="20,24,0,0" VerticalAlignment="Top" Grid.Row="2" FontSize="16"/>
        <TextBox Text="{Binding MovingHeartRateAverage}" HorizontalAlignment="Center" Margin="0" TextWrapping="Wrap"  VerticalAlignment="Center" IsEnabled="False" TextAlignment="Center" FontSize="24" FontWeight="Bold" Grid.Column="1" Grid.Row="2" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
            <TextBox.DataContext>
                <Binding Source="{StaticResource PropertiesViewModel}"/>
            </TextBox.DataContext>
        </TextBox>
        <Button Command="{Binding Path=StartWorkoutCommand}" Content="Start New Workout" Margin="20" FontSize="16">
            <Button.DataContext>
                <Binding Source="{StaticResource CommandsViewModel}"/>
            </Button.DataContext>
        </Button>
        <Button Command="{Binding Path=StoptWorkoutCommand}" Content="Stop Workout" Margin="20" Grid.Column="1" FontSize="16">
            <Button.DataContext>
                <Binding Source="{StaticResource CommandsViewModel}"/>
            </Button.DataContext>
        </Button>
    </Grid>
</Page>